<template>
  <router-view style="width: 100%;height: 100%;overflow: hidden;" v-slot="{ Component }">
    <template v-if="Component">
      <keep-alive>
        <Suspense>
          <template #default>
            <transition name="fade-transform" mode="out-in">
              <component :is="Component"></component>
            </transition>
          </template>
          <template #fallback> loading... </template>
        </Suspense>
      </keep-alive>
    </template>
  </router-view>
</template>
<script lang="ts" setup>

</script>
<style lang="scss">
.fade-transform-leave-active,
.fade-transform-enter-active {
  transition: all .2s;
}

.fade-transform-enter {
  opacity: 0;
  transform: translateX(-30px);
}

.fade-transform-leave-to {
  opacity: 0;
  transform: translateX(30px);
}
</style>